<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
	<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
	<script type="text/javascript">
		$(function(){
			$("form").submit(function(){
				if($(":text:eq(0)").val()==""){
					alert("回答为必填项!");
					return false;
				}
			});
		});
	</script>
</head>
<body>
	问题:${question.title }<br/>
	问题描述:${question.detailDesc }<br/>
	网友回答:
	<c:forEach items="${answers }" var="ans">
		<fmt:formatDate value="${ans.ansDate }" pattern="yyyy-MM-dd HH:mm:ss"/><br/>
		${ans.ansCount }
		<hr/>
	</c:forEach>
	<form action="/c_answers/myanswer" method="post">
	<input type="hidden" name="qid" value="${question.id }"/>
	我来回答:<textarea name="ansCount"></textarea><br/>
	<input type="submit" value="提交回答"/>
	<br>
	<br>
	<a href="/c_answers/">返回首页</a>
	</form>
</body>
</html>